/******************************************************************
 * @Title: SecureInterceptor.java 
 * @Package com.omni.web.component 
 * @Description: Hack into the page flow of spring mvc working. 
 * @author Dellinger
 * @date 2015年4月22日 上午12:21:14 
 * @version v1.0 
 * @copyright Omnikennect.com
 ******************************************************************/
package com.omni.web.component;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;

/** 
 * @ClassName: SecureInterceptor 
 * @Description: TODO 
 * @author Dellinger
 * @date 2015年4月22日 上午12:21:14 
 *  
 */
public class SecureInterceptor implements HandlerInterceptor {
	
	private static final Logger logger = LoggerFactory.getLogger(SecureInterceptor.class);
	
	/* (non-Javadoc)
	 * @see org.springframework.web.servlet.HandlerInterceptor#afterCompletion(
	 * 			javax.servlet.http.HttpServletRequest, 
	 * 			javax.servlet.http.HttpServletResponse, 
	 * 			java.lang.Object, java.lang.Exception)
	 */
	@Override
	public void afterCompletion(HttpServletRequest arg0,
			HttpServletResponse arg1, Object arg2, Exception arg3)
			throws Exception {
		
		logger.info("===>afterCompletion");
	}

	/* (non-Javadoc)
	 * @see org.springframework.web.servlet.HandlerInterceptor#postHandle(
	 * 			javax.servlet.http.HttpServletRequest, 
	 * 			javax.servlet.http.HttpServletResponse, 
	 * 			java.lang.Object, 
	 * 			org.springframework.web.servlet.ModelAndView)
	 */
	@Override
	public void postHandle(HttpServletRequest arg0, HttpServletResponse arg1,
			Object arg2, ModelAndView arg3) throws Exception {
		
		logger.info("===>postHandle");
	}

	/* (non-Javadoc)
	 * @see org.springframework.web.servlet.HandlerInterceptor#preHandle(
	 * 			javax.servlet.http.HttpServletRequest, 
	 * 			javax.servlet.http.HttpServletResponse, 
	 * 			java.lang.Object)
	 */
	@Override
	public boolean preHandle(HttpServletRequest arg0, HttpServletResponse arg1,
			Object arg2) throws Exception {
		logger.info("===>preHandle");
		return true;
	}

}
